home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 1
/
CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso
/
Aminet
/
comm
/
cnet
/
cnettoolkit2a.lha
/
CNet_ToolKit.REXX!
< prev
next >
Wrap
Text File
|
1994-12-16
|
62KB
|
1,443 lines
****************************************************************************
CNet ARexx Tool Kit, v2.0 by PMK & DOTORAN - For CNet v3.05c & Beyond!
A Collection of Useful ARexx SubRoutines & Procedures!
Please use ANY of these in your OWN ARexx Creations!
$VER: CNet ARexx Tool Kit, v2.0 (16-Dec-94) by PMK & Dotoran!
****************************************************************************
CONTENTS:
[01] : From "Expanded" date to "Sorted" or "Internal" date format.
[02] : From x5xxxxx GU Value to "Sorted" or "Internal" date format.
[03] : From "Sorted" or "Internal" date to "Expanded" date format.
[04] : "Signed" Numeric Format into "UnSigned" Numeric Format.
[05] : "UnSigned" Numeric Format into "Signed" Numeric Format.
[06] : Numeric Range Parser: [ -2 19- 4 7-9 11.13.15,17 ]
[07] : CNet-like input routine, using MCI.
[08] : Find and return BBSTEXT/BBSMENU line entry.
[09] : Check if a user is Suboperator in current subboard.
[10] : Checks if MCI is enabled in current subboard.
[11] : Convert from 12/24 hour time format to 12/24/min format.
[12] : External Library Loader
[13] : View, Enable, Disable or Toggle "Priviledge" Flags.
[14] : Get "Arguments" from last command.
[15] : Read "Cursor Key" / "Return/Enter" Keyboard Input.
[16] : Convert "UPPERCASE" to "lowercase" text.
[17] : Pauses output for "x" number of seconds the RIGHT way!
[18] : Checks for "Loss of Carrier" in your Pfiles!
[19] : An informative "Error Checking" routine.
[20] : Positions cursor for printing anywhere on the screen.
[21] : Horizontal Text Scroller Number 1.
[22] : Horizontal Text Scroller Number 2.
[23] : Read the joystick(s) and firebutton(s).
[24] : First attempt at MOUSE capability. (95% Complete!)
[25] : Disable or Enable the MORE? prompt, regardless of setting!
[26] : Muffle ALL ports, regardless of setting!
[27] : Extended SelectFile Routine.
[28] : Add line of text to specified LOG file.
[29] : Check Port Menu(s) Checkmark Status.
[30] : Send Text File as CNet MAIL to specified User.
[31] : Send SystemOLM to current user.
[32] : Add keystrokes to other ports from present port.
[33] : A QUICK "Who" for SysOps, listing Access Group Number.
[34] : View "port" log of specified port. (Pre "calls" log).
[35] : Send Line Noise to a port (Ability to kick them off too!)
[36] : UnLock User Accounts (That May NOT Have Been Previously!)
[37] : Replace <input> with <output> within string of <text>.
[38] : Find and return BBSMENU section line(s).
[39] : Clears a specific port, by dumping the user.
[40] : EnCode & DeCode text strings, using a Numeric Key.
****************************************************************************
/**[01]*********************************************************************
*
* Description: From "Expanded" date to "Sorted" or "Internal" date format.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Expanded: Sun 25-Dec-1993 11:53a
* Sorted: 19931225 (In YYYYMMDD Format)
* Internal: 5837 (In Days Format)
*
* Usage: <var>=SDATE(<date>,[mode])
*
* Where: <date> holds an "Expanded" Date.
* [mode] as 'i' returns Internal Days Format.
* (Number of days since January 1, 1978)
*
* Returns: <var> holds the sorted (or internal) date format.
*
* Note 1: Because of the way the internal ARexx DATE() command works,
* you should NOT use dates PREVIOUS to January 1, 1978 when
* using the 'i' (internal) setting. This routine will, however
* return the SORTED date for ANY DATE given.
*
* Note 2: We decided to keep the 'i' parameter, because it's a FAST
* way to perform MATH functions on dates(13 days ago, etc).
*/
getuser 1500000 ; d1=result ; d2=SDATE(d1) ; d3=SDATE(d1,'i')
transmit 'Expanded Date: 'd1
transmit ' Sorted Date: 'd2
transmit 'Internal Days: 'd3
exit
SDATE: procedure;arg da,mo
da=substr(da,12,4)right(index('ANEBARPRAYUNULUGEPCTOVEC',substr(da,9,2))%2+1,2,'0')right(strip(substr(da,5,2)),2,'0')
if mo='I' then return date('i',da,'s')
return da
/**[02]*********************************************************************
*
* Description: From x5xxxxx GU Value to "Sorted" or "Internal" date format.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* x5xxxxx: 1500000, 1500410, 2500990, etc.
*
* Sorted: 19930120 (In YYYYMMDD Format)
*
* Internal: 5837 (In Days Format)
*
* Usage: <var>=SDATE(<value>,[mode])
*
* Where: <value> holds the 7-Digit x5xxxxx GetUser Value.
* [mode] as 'i' returns Internal Days Format.
* (Number of days since January 1, 1978)
*
* Returns: <var> holds the sorted (or internal) date format.
*
* Note 1: Because of the way the internal ARexx DATE() command works,
* you should NOT use dates PREVIOUS to January 1, 1978 when
* using the 'i' (internal) setting. This routine will, however
* return the SORTED date for ANY DATE given.
*
* Note 2: We decided to keep the 'i' parameter, because it's a FAST
* way to perform MATH functions on dates(13 days ago, etc).
*/
getuser 1500416;a=result;transmit 'Expanded 1st Call Date: 'a
d1=GDATE(1500416);transmit ' Sorted 1st Call Date: 'd1
d2=GDATE(1500416,'i');transmit 'Internal 1st Call Date: 'd2
exit
GDATE: procedure;arg da,mo;getuser da;da=result
da=substr(da,12,4)right(index('ANEBARPRAYUNULUGEPCTOVEC',substr(da,9,2))%2+1,2,'0')right(strip(substr(da,5,2)),2,'0')
if mo='I' then return date('i',da,'s')
return da
/**[03]*********************************************************************
*
* Description: From "Sorted" or "Internal" date to "Expanded" date format.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Sorted: 19931225 (In YYYYMMDD Format)
* Internal: 5837 (In Days Format)
* Expanded: Sun 25-Dec-1993 (No time format!)
*
* Usage: <var>=EDATE(<date>,[mode])
*
* Where: <date> holds a "Sorted" or "Internal" Date.
* [mode] Specified as 'i' if <date> supplied is in
* Internal Days Format.
* (Number of days since January 1, 1978)
*
* Returns: <var> holds the expanded date format.
*
* Note 1: Because of the way the internal ARexx DATE() command works,
* you should NOT use dates PREVIOUS to January 1, 1978 when
* using the 'i' (internal) setting. This routine will, however
* return the SORTED date for ANY DATE given.
*
* Note 2: We decided to keep the 'i' parameter, because it's a FAST
* way to perform MATH functions on dates(13 days ago, etc).
*/
d1='19940802' ; d2=EDATE(d1) ; d3='6000' ; d4=EDATE(d3,'i')
transmit ' Sorted Date: 'd1' = Expanded Date: 'd2
transmit 'Internal Days: 'd3' = Expanded Date: 'd4
exit
EDATE: procedure;arg da,mo;if mo='I' then da=date('s',da,'i')
return left(date('w',da,'s'),3)right(' 'strip(translate(date('n',da,'s'),'-',' '),'L','0'),12)
/**[04]*********************************************************************
*
* Description: "Signed" Numeric Format into "UnSigned" Numeric Format.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: <var>=SIGNED(<value>,<size>)
*
* Where: <var> is the variable to store converted number in.
* <value> is the signed value to convert.
* <size> is the bit-size of the number(8, 16, 32)
*
* Returns: <var> holds the converted number.
*
* GetUser # of Bits Signed Range UnSigned Range
***************************************************************************
* x1xxxxx 8 -127 to 128 0 to 255
* x2xxxxx 16 -32,767 to 32,768 0 to 65,535
* x4xxxxx 32 -2,147,483,647 to 2,147,483,648 0 to 4,294,967,295
*
* If using 32-bit values, include "NUMERIC DIGITS 10" somewhere at the
* start of your program, else the routine will choke on the scientific
* notation used with the standard "NUMERIC DIGITS 9" default setting.
*
* Also, if using 32-bit values with BINARY digits(as in CNet FLAGS), be
* advised that if flag # 31 is used, INCORRECT results will be given. You
* will have to read the value as two 16-bit values and combine them to form
* your binary string. (Examples of both are given below)
*/
numeric digits 10
getuser 1400648 ; a=result ; c=SIGNED(a,32)
transmit "User's Message Base Flags:n1"
transmit 'As one 32-Bit Value:n1'
transmit ' Signed Value: 'a
transmit 'UnSigned Value: 'c
transmit ' Binary String: 'reverse(c2b(d2c(c,4)))
getuser 1200648 ; a1=result ; c1=SIGNED(a1,16)
getuser 1200650 ; a2=result ; c2=SIGNED(a2,16)
transmit 'n1As two 16-Bit Values:n1'
transmit ' Signed Value: 'a
transmit 'UnSigned Value: 'c
transmit ' Binary String: 'reverse(c2b(d2c(c1,2))c2b(d2c(c2,2)))
exit
SIGNED: ; return ARG(1)+((ARG(1)<0)*256**(ARG(2)%8))
/**[05]*********************************************************************
*
* Description: "UnSigned" Numeric Format into "Signed" Numeric Format.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=UNSIGNED(<value>,<size>)
*
* Where: <value> is the signed value to convert.
* <size> is the bit-size of the number(8, 16, 32)
*
* Returns: <var> holds the converted number.
*
* GetUser # of Bits Signed Range UnSigned Range
***************************************************************************
* x1xxxxx 8 -127 to 128 0 to 255
* x2xxxxx 16 -32,767 to 32,768 0 to 65,535
* x4xxxxx 32 -2,147,483,647 to 2,147,483,648 0 to 4,294,967,295
*
* If using 32-bit values, include "NUMERIC DIGITS 10" somewhere at the
* start of your program, else the routine will choke on the scientific
* notation used with the standard "NUMERIC DIGITS 9" default setting.
*
* This routine is handy when you CHANGE the value of a signed number. You
* have to change it to an UNSIGNED number before you can manipulate it, but
* you then have to convert it back to a SIGNED number before you can save
* the value using the PUTUSER command.
*/
numeric digits 10
transmit 'Sets Message Base Flags "25-31":n1'
a=4261412864 ; c=UNSIGNED(a,32)
transmit 'Unsigned Value: 'a
transmit ' Signed Value: 'c'n1'
transmit ' ARexx Code: SETOBJECT 'c' ; PUTUSER 1400648'
exit
UNSIGNED:;return ARG(1)-(ARG(1)>((256**(ARG(2)%8))/2)-1)*256**(ARG(2)%8)
/**[06]*********************************************************************
*
* Description: Numeric Range Parser: [ -2 19- 4 7-9 11.13.15,17 ]
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
* PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=PARSE(<range>,<min>,<max>,[sort])
*
* Where: <var> is any Legal Variable Name.
* <range> is the Numeric Range to Parse.
* <min> is the Minimum Value to Use.
* <max> is the Maximum Value to Use.
* [sort] as 's' is OPTIONAL. If specified, the items will
* also be Numerically Sorted. Duplicate Item checking
* is ONLY performed on SORTED item lists.
*
* Returns: <var> total parsed items.
* <it.0> parsed item string, parsed in SPACES.
* <it.1>
* |
* <it.?> the individual parsed item array.
*
* Note 1: This routine functions EXACTLY like CNet's own routine.
* Open ended ranges( -5 or 12- ) fully supported. Any use
* of DUPLICATE item numbers are removed, and the resulting
* it.? array contains items in NUMERICAL Order. All Non-
* Numeric items are discarded. Use the "it.0" variable
* string in conjunction with the INDEX() command for VERY
* FAST verification checking!
*
* Note 2: If sorting is NOT essential to your needs in a particular
* application, we suggest NOT using it, as it will speed up
* the parsing process CONSIDERABLY! (VERY, VERY QUICK!)
*/
transmit '>4Minimum: 0n1>4Maximum: 25n1>7Sort: ONn1'
transmit ' An Example: -2 19- 4 7-9 11.13.15,17n1'
query 'Enter Range: ' ; tot=PARSE(result,0,25,'s')
transmit 'n1 ARexx Code: result="'result'"'
transmit "Ctot=PARSE(result,0,25,'s')n1"
transmit 'Total Items: 'tot ; transmit 'Parsed Data: 'it.0
do i=1 to tot ; transmit ' Item # 'right(i,2)': 'it.i ; end i
exit
PARSE: procedure expose it.; arg rng,min,max,srt
it.='';c=0;it=translate(rng,' ','.,')
do a=1 to words(it);c=c+1;it.c=word(it,a)
if index(it.c,'-')>0 then do;parse var it.c x'-'y
if y='' then y=max;if x='' then x=min
if x>y then do;d=x;x=y;y=d;end
if x<min|y>max|~datatype(x,'W')|~datatype(y,'W') then do;c=c-1;iterate;end
do b=x to y;it.c=b;c=c+1;end;c=c-1;end
else if it.c<min|it.c>max|~datatype(it.c,'W') then do;c=c-1;iterate;end;end
/* Leave the following SORT routine OUT if you plan on NEVER Sorting! */
if c>0 & upper(arg(4))='S' then do;do a=1 to c-1;d=a;do b=a+1 to c;d=d+1
if it.d<it.a then do;y=it.a;it.a=it.d;it.d=y;end
else if it.d=it.a then do;it.d=it.c;c=c-1;d=d-1;end;end;end;end;a=0
do i=1 to c;j=i+1;if it.i~=it.j then do;a=a+1;it.a=it.i;end;end;c=a
/* This code MUST APPEAR, whether you use the above SORT routine or NOT! */
do i=1 to c;it.0=it.0||it.i' ';end
return c
/**[07]*********************************************************************
*
* Description: CNet-like input routine, using MCI.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=INPUT(<text>,<length>,<MCI opt>,[default])
*
* Where: <text> holds the prompt text.
* <length> holds the max length of the input.
* <MCI opt> MCI input options (1=caps, 2=filename, etc.)
* (Review the MCI {I } Command for more info!)
* [default] holds the default text to appear under the
* cursor in the prompt.(OPTIONAL)
*
* Returns: <var> holds data that was input.
*/
getuser 3 ; a=INPUT('n1Who are you?n1:',20,128,result)
transmit 'n1answer='a ; exit
INPUT:;transmit arg(1)' L1305640 #'arg(4)'}I'arg(3)+4' 'arg(2)'}'
getuser 70;return result
/**[08]*********************************************************************
*
* Description: Find and return BBSTEXT/BBSMENU line entry.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=BBSLINE(<file>,<line>)
*
* Where: <file> which file to use. (0=BBSMENU, 1=BBSTEXT)
* <line> holds the line number in BBSTEXT/BBSMENU.
*
* Returns: <var> holds the returned BBSTEXT/BBSMENU line entry.
*/
transmit bbsline(1,4)' : line 4 in BBSTEXT'
transmit bbsline(0,7)' : line 7 in BBSMENU'
exit
BBSLINE: procedure;arg ty,li;getuser 1402018+(ty*4)
ln=import(import(offset(x2c(d2x(result,8)),(li-1)*4),4),1024)
parse var ln ln'00'x .;return ln
/**[09]*********************************************************************
*
* Description: Check if a user is Suboperator in current subboard.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=SUBOP(<id>)
*
* Where: <id> is the ID number of the user.
*
* Returns: <var> holds "1" if the user has Subop access, "0" if not.
*/
getuser 41;if SUBOP(result) then transmit 'Subop';else transmit 'Not Subop'
exit
SUBOP: procedure;id=x2c(d2x(arg(1),8));getuser 1209388;su=result*488+96
getuser 2401068;so=import(x2c(d2x(result+su,8)),24)
do a=0 to 5;if id=substr(so,a*4+1,4) then return 1;end;return 0
/**[10]*********************************************************************
*
* Description: Checks if MCI is enabled in current subboard.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=MCIENA()
*
* Returns: <var> holds "1" if MCI is enabled, "0" if not.
*/
if MCIENA() then transmit 'MCI enabled in this Subboard'
else transmit 'MCI disabled in this Subboard'
exit
MCIENA: procedure;getuser 1209388;sub=result*488+243
getuser 2401068;return c2d(import(x2c(d2x(result+sub,8)),1))=0
/**[11]*********************************************************************
*
* Description: Convert from 12/24 hour time format to 12/24/min format.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=TIM(<value>,<mode>)
*
* Where: <value> is the getuser time value to convert.
* <mode> is the format to convert to:
* (12=12 Hr., 24=24 Hr., 0=Mins. Since Midnight)
*
* Returns: <var> holds the converted time value.
*/
getuser 1500000 ; tia=result
transmit 'Getuser = 'tia
transmit '12 hour = 'tim(tia,12)
transmit '24 hour = 'tim(tia,24)
transmit 'Minutes = 'tim(tia,0)
exit
TIM: procedure;parse arg ti,mo;ti=right(ti,6);select
when mo=12&verify(ti,'ap','M')~=6 then if left(ti,2)>12 then ti=' 'left(ti,2)-12||substr(ti,3,3)'p';else ti=ti'a'
when mo=24&verify(ti,'ap','M')=6 then ti=left(ti,2)+12||substr(ti,3,3)
otherwise if mo=0 then ti=(left(ti,2)+(verify(ti,'ap','M')=6)*12)*60+substr(ti,4,2)
end;return ti
/**[12]*********************************************************************
*
* Description: External Library Loader
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call LOADLIB("<library>")
*
* Where: <library> is the filename of the external library to load,
* inside of either double or single quotation marks.
*
* Returns: If library exists, it will be loaded, but if an error occurs
* during the load, you'll be told this and your file will
* immediately be terminated. (This occurs if the stated library
* is not located in your LIBS: path.)
*/
options results
call LOADLIB("rexxsupport.library")
exit
LOADLIB: procedure ; parse arg lib ; if ~exists('libs:'lib) then do
transmit 'Error loading...'lib;bufferflush;exit;end
addlib(lib,0,-30,0) ; return
/**[13]*********************************************************************
*
* Description: View, Enable, Disable or Toggle "Priviledge" Flags.
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call PRIV(<mode>,<priv>,<name>)
*
* Where: <mode> is the KEYWORD (or first LETTER of KEYWORD)
* of the action to be performed:
*
* V or VIEW - Current Priviledge Setting.
* T or TOGGLE - Reverse Current Setting.
* E or ENABLE - Turn the Priviledge ON.
* D or DISABLE - Turn the Priviledge OFF.
*
* <priv> is the Priviledge Index Number found on the
* GetUser 3.1 List(The Number from 1 to 64)
*
* <name> is the ID Number, Handle, or Real Name of the
* user to perform the action on, whether they are
* ONLINE or NOT! (Uses CNet's Scratch Buffer!)
*
* Returns: <priv> holds a "Yes" if user HAS this Priviledge, or
* "No" if user DOESN'T have Priviledge.
* (Updated AFTER Action Has Taken Place!)
*
* <privs> holds 64 bits of 1's and 0's where Bit 1 is the
* leftmost bit and Bit 64 is the rightmost bit.
*
* <handle> of the user action was performed on, even if
* you entered an ID Number as the initial argument!
*
* <status> will be a "1" if data saved successfully, or
* "0" if there was a problem saving.
* (Note this variable NOT used in VIEW Mode!)
*/
call PRIV(View,15,Dotoran);transmit ' VIEW: Can 'handle' Conference? 'priv
call PRIV(Enable,29,David Weeks);transmit 'ENABLE: 'handle' is now a SysOp!'
call PRIV(View,3,1);transmit ' VIEW: Use RELOGON: 'priv;call PRIV(Toggle,3,1)
transmit 'TOGGLE: RELOGON command for 'handle' has been toggled.'
call PRIV(View,3,1);transmit ' VIEW: Use RELOGON: 'priv
exit
PRIV: procedure expose priv privs handle status
arg mode,priv,id;b='';c=left(mode,1);if datatype(id,'n')=0 then do;findaccount id;id=result;end
if id=0 then do;transmit 'Invalid Handle! Aborted!';return;end;loadscratch id;getscratch 1;handle=result
if handle='!' then do;transmit 'Empty Account! Aborted!';savescratch (-id);return;end
do i=0 to 3;getscratch 1101332+i;a=result;b=b||reverse(c2b(d2c(a+(a<0)*256)));end i
do i=0 to 3;getscratch 1101380+i;a=result;b=b||reverse(c2b(d2c(a+(a<0)*256)));end i;privs=b
if c='E' then privs=overlay('1',privs,priv,1);if c='D' then privs=overlay('0',privs,priv,1)
if c='T' then do;a=substr('10',substr(privs,priv,1)+1,1);privs=overlay(a,privs,priv,1);end
priv=subword('No Yes',substr(privs,priv,1)+1,1);if c='V' then do;savescratch (-id);return;end
do i=0 to 3;a=c2d(b2c(reverse(substr(privs,i*8+1,8))));a=a-(a>127)*256;setobject a;putscratch 1101332+i;end i
do i=0 to 3;a=c2d(b2c(reverse(substr(privs,32+i*8+1,8))));a=a-(a>127)*256;setobject a;putscratch 1101380+i;end i
savescratch id;status=result
return
/**[14]*********************************************************************
*
* Description: Get "Arguments" from last command.
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
* PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=ARGS()
*
* Where: <var> is any legal variable name.
*
* Returns: <var> holds total number of arguments. (Max of 6)
* <arg.0> holds command text/name.
* <arg.1> holds 1st argument.
* | thru
* <arg.6> holds 6th argument.
*
* Note 1: Max length of any one argument is 61 characters, and any
* unused arguments will contain the null string.
*
* Note 2: If using CNet 2.63 thru CNet 3.04, add 1 to <var> to
* find total number of arguments. Also, the 1st argument
* is stored in "arg.0", 2nd in "arg.1" and so on. This
* routine was written for CNet Amiga, v3.05!
*/
total=ARGS() ; transmit 'Arguments: 'total ; transmit ' Command: 'arg.0
do i=1 to total ; transmit '>4Arg 'i': 'arg.i ; end i
exit
ARGS: procedure expose arg. ; getuser 1202244
do i=0 to result ; getuser 1302246+(i*61) ; arg.i=result ; end
return i-2
/**[15]*********************************************************************
*
* Description: Read "Cursor Key" / "Return/Enter" Keyboard Input.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: <var> = GETCURSOR()
*
* Returns: <var> will be "8" if UP arrow was pressed.
* will be "2" if DOWN arrow was pressed.
* will be "4" if LEFT arrow was pressed.
* will be "6" if RIGHT arrow was pressed.
* will be "5" if ENTER or RETURN pressed.
*
* Note 1: Returned values are identical to the numeric keypad layout,
* so programs using this routine can be accessed by people who
* do not have directional cursor keys (A600, C64, etc.)
*
* Note 2: If key pressed was none of the above, then <var> will hold
* the actual character that WAS pressed. Returned keys will be
* UPPERCASE to mimic the same action as the GETCHAR command.
*/
START:;key=GETCURSOR();transmit key;if key~='Q' then signal START;exit
GETCURSOR: procedure;do until key~='NOCHAR';maygetchar;key=result;end
if key='1B'x then do 2;maygetchar;key=result;end;else if key='D'x then return '5';else return upper(key)
if key='A' then return '8';if key='B' then return '2';if key='C' then return '6';if key='D' then return '4'
return upper(key)
/**[16]*********************************************************************
*
* Description: Convert "UPPERCASE" to "lowercase" text.
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
* PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var> = LOWER(<text>)
*
* Where: <var> is any valid variable name.
* <text> holds the text to be converted.
*
* Returns: <var> contains the converted lowercase text.
*/
old="The QUICK Brown fox jumped over the LAZY log!";new=LOWER(old)
transmit 'Mixed Text: 'old;transmit 'Lower Text: 'new;exit
LOWER:;return translate(ARG(1),xrange('a','z'),xrange('A','Z'))
/**[17]*********************************************************************
*
* Description: Pauses output for "x" number of seconds the RIGHT way!
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
* PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: call PAUSE(<seconds>)
*
* Where: <seconds> is the number of seconds to wait.
*
* Note: This routine uses the DELAY() function, located in the
* support library "rexxsupport.library". See the intro above
* for more info on using this library.
*/
transmit 'Print this line, now wait 5 seconds...'
call PAUSE(5);transmit 'Now print this line!';exit
PAUSE:;a=delay(Arg(1)*50);return
/**[18]*********************************************************************
*
* Description: Checks for "Loss of Carrier" in your Pfiles!
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage 1: <var> = CHECK(<result>)
*
* Usage 2: call CHECK
*
* Where: <var> is any valid variable name.
*
* Note 1: Use [Usage 1] after you INPUT data using these commands:
* GETCHAR, RECEIVE, PROMPT, the MCI {i }, etc.
*
* Note 2: Use [Usage 2] to simply CHECK for CARRIER. It's a good
* idea to use a few of these calls in places where your
* program may be doing numerous things WITHOUT the user
* having to enter any input.
*/
getchar;a=CHECK(result);transmit a;call CHECK;transmit 'It still works';exit
CHECK:;if ARG() & ARG(1)~='###PANIC' then return ARG(1)
getcarrier;if result='TRUE' then if ARG() then return ARG(1);else return
/* You may wish to call SAVE DATA routines here, before exiting! */
logentry 'Lost Carrier!!';bufferflush;exit
/**[19]*********************************************************************
*
* Description: An informative "Error Checking" routine.
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: To use this routine, place it somewhere near the end of
* your program, then at the top of your program, normally
* right after your "options results" statement, place this
* line of text:
*
* signal on SYNTAX ; signal on ERROR ; signal on IOERR
*
* Returns: If an error is encountered, you will be alerted as to
* it's nature and cause as well as being shown the name of
* the file the error occurred in, the line number and actual
* line the error occurred in. This same information will also
* be noted in your "calls" log(or in "ARexx_Says"). The file
* will then be terminated.
*
* Note 1: Each line is formatted for 46 characters, the maximum width
* stated on line 845 of BBSTEXT for inclusion into the logs.
* If you include MCI/ANSI color codes into these lines, then
* change the "%-.45s" on line 845 of BBSTEXT to read "%s".
*/
signal on SYNTAX ; signal on ERROR ; signal on IOERR
average=(10+20+30+40/4 /* Causes the "Unbalanced Parenthesis" error. */
SYNTAX:;ERROR:;IOERR:;e1=' Error: 'rc' ('errortext(rc)')';e2=' Line: 'left(sigl,4)'File:'
getuser 1311992;a=result;getuser 1311960;b=result;c='"'a||b'"';e2=e2' 'c;transmit e1;transmit e2;logentry e1;logentry e2
e=sourceline(sigl);do while e~='';e3='Source: 'left(e,37);transmit e3;logentry e3;e=substr(e,38);end;bufferflush;exit
/**[20]*********************************************************************
*
* Description: Positions cursor for printing anywhere on the screen.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: <command> AT(<row>,<col>)"<text>"
*
* Where: <command> could be TRANSMIT, SENDSTRING, QUERY, etc.
* <row> is the row text will print on.
* <col> is the column text will start at.
* <text> is the text to be printed, within quotes.
*
* Returns: will print given text at the given screen position.
*/
transmit 'f1'
transmit AT(1,1)"Will this work?"AT(10,10)"Hello World"
do i=3 to 13 ; sendstring AT(i,50)"Looped Text; Iteration "i-2 ; end
query AT(15,25)"Press ENTER Now..."
exit
AT:;return ''arg(1)';'arg(2)'H'
/**[21]*********************************************************************
*
* Description: Horizontal Text Scroller Number 1.
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call SCROLLER(clr,ro1,co1,ro2,co2,dir,"txt")
*
* Where: <clr> Clear Screen First? (0=No, 1=Yes)
* <ro1> Row to START scrolling at.
* <co1> Column on "ro1" to START scrolling at.
* <ro2> Row to STOP scrolling at.
* <co2> Column on "ro2" to STOP scrolling at.
* <dir> Scroll Direction: 0=Left, 1=Right, 2=Alternate
* <txt> Text to be Scrolled, inside DOUBLE quotes.
*
* Results: The <txt> line will be scrolled between the two columns
* on each ROW individually, starting at "ro1" and ending
* at "ro2". You can STOP the Scrolling prematurely by
* pressing any key.
*/
transmit 'f1cf8H'copies('*',44)'18H*61H*18H'copies('*',44)'c9'
call SCROLLER(0,10,20,10,60,2,"CNet Amiga ToolKit, v2.0 by Dotoran & PMK!")
exit
SCROLLER: procedure;parse arg clr,ro1,co1,ro2,co2,dir,txt;txt=copies(' ',co2-co1)||txt' ';if clr then cls
do i=ro1 to ro2;lo=1;in=1;hi=length(txt);if dir=2 then d2=(i/2=i%2);if d2=0 then do;lo=hi;hi=1;in=-1;end
do j=lo to hi by in;maygetchar;if result~='NOCHAR' then leave i;ch=substr(txt,j,co2-co1);transmit ''i';'co1'H'ch;end j;end i
return
/**[22]*********************************************************************
*
* Description: Horizontal Text Scroller Number 2.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: call SCROLL(<row>,<"txt">)
*
* Where: <row> is the Screen Row to be Scrolled.
* <"txt"> is the Text Line to be Scrolled, within quotes.
*
* Note 1: You can use three special characters inside your text
* string to affect the SPEED at which the text is shown:
*
* Press ALT-1 (¹) for Fastest Speed.
* Press ALT-2 (²) for Medium Speed.
* Press ALT-3 (³) for Slowest Speed.
*
* This routine uses the DELAY() command to create the speeds,
* which means the "rexxsupport.library" is also needed.
*
* Note 2: The text string will be scrolled from RIGHT to LEFT,
* starting at the right edge of the user's default Line
* Length(40,80,etc.) You can abort the scrolling at any
* time by pressing any key.
*
* Note 3: An interesting alternate use for this routine is to
* scroll the EXISTING text on the screen. To do this,
* specify the "row" you wish to Scroll, then use "" as
* the Text to Scroll. Nothing NEW will appear on the
* screen, but any EXISTING characters ON that row will
* be scrolled off the left side of the screen!
*/
text='²CNet Amiga ToolKit, v2.0 by >> PMK and Dotoran << '
text=text||'³³³³³³³³¹ This is a test of the SCROLL subroutine'
call SCROLL(15,text);exit
SCROLL: procedure;parse arg line,text;sp=2;getuser27;ll=result-1
do a=1 to length(text)+ll;ch=substr(text,a,1);if index('¹²³',ch)>0 then sp=translate(ch,'246','¹²³')
else sendstring ''line';0HP'line';'ll'H'ch;call delay(sp);maygetchar;if result~='NOCHAR' then leave;end
return
/**[23]*********************************************************************
*
* Description: Read the joystick(s) and firebutton(s).
*
* Author(s): Thomas - Dreamline Amiga BBS +45 3582-7043
* PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=JOY(<joynum>)
*
* Where: <joynum> is the Joy port (0=Port1, 1=Port2)
*
* Returns: <var> holds keypad values for directions, "0" if none.
* and value+10 if the firebutton was pressed.
*
* Note 1: This routine will allow the joystick(s) to be used from the
* LOCAL port only. It will NOT function from remote.
*
* Note 2: Press your ENTER/RETURN key to exit the example given below.
*/
do until key='0d'x ; maygetchar; key=result
transmit 'f1'JOY(1) ; end ; exit
JOY: procedure;arg w;a=import(d2c(14675978+w*2,4),2);b=~bittst(import('00BF E001'x,1),6+w)*10
return x2d(translate(c2x(b2c(bittst(a,8)bittst(a,9)bittst(a,0)bittst(a,1))),'963147','B31EC4'))+b
/**[24]*********************************************************************
*
* Description: First attempt at MOUSE capability. (95% Complete!)
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: <var> = MOUSE(<row>,<col>,<length>)
*
* Where: <var> is any valid variable name.
* <row> is the ROW the button is located on.
* <col> is the COLUMN the button STARTS at.
* <length> is the LENGTH(in Columns) of this button.
*
* Returns: <var> will be "1" if the Mouse Button WAS pressed.
* will be "0" is the Mouse Button WASN'T pressed.
*
* Note 1: This routine is lacking the ability to catch when you
* "double-click" on a button, and will not ALWAYS catch
* when you DO click on a button. If anyone can offer us
* a better MOUSE() routine, please send us a copy and
* we'll include it in the next version(with your name)!
*
* Note 2: The following example program can also be aborted by
* pressing any key, instead of using the mouse.
*/
transmit 'f1Hz7c4 Press Me z060Hz6cb QUIT z0'
do until b1+b2>0;b1=MOUSE(5,5,12);b2=MOUSE(20,60,8);maygetchar
if result~='NOCHAR' then do;transmit 'A Keyboard Key was pressed.';exit;end;end
if b1=1 then transmit '"Press Me" was pressed.';if b2=1 then transmit '"QUIT" was pressed.'
exit
MOUSE: procedure;getuser 1202140;xc=result%8+1 ; getuser 1202142;yc=(result-11)%8+1
return arg(1)=yc & xc>=arg(2) & xc<arg(2)+arg(3) & bittst(import('00BF E001'x,1),6)=0
/**[25]*********************************************************************
*
* Description: Disable or Enable the MORE? prompt, regardless of setting!
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage 1: call NOMORE
*
* Usage 2: call MORE
*
* Before Use: Add this line somewhere at the START of your file, so that
* it will only be run ONCE:
*
* getuser 1100454;oldmore=result
*
* After Use: When you're ready to LEAVE your file, place this line BEFORE
* every occurrance of the command EXIT:
*
* setobject oldmore;putuser 1100454
*
* Note 1: Use [Usage 1] when you wish to DISABLE the More? Prompt,
* Use [Usage 2] when you wish to ENABLE the More? Prompt.
*
* Note 2: Be sure to add the above two lines to insure the user's
* chosen More? setting is returned to it's original setting!
*/
getuser 1100454;oldmore=result
transmit 'With the More? Prompt disabled...'
call NOMORE ; sendfile 'systext:help/mci'
transmit 'Now with More? Prompt enabled...'
call MORE ; sendfile 'systext:help/mci'
setobject oldmore;putuser 1100454
exit
NOMORE:;sendstring 'L1100454 #0}';return
MORE:;sendstring 'L1100454 #1}';return
/**[26]*********************************************************************
*
* Description: Muffle ALL ports, regardless of setting!
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call MUFFLE
*
* Before Use: Add this line somewhere at the START of your file, so that
* it will only be run ONCE:
*
* getuser 1101745 ; muffle=result ; call MUFFLE
*
* After Use: When you're ready to LEAVE your file, place this line BEFORE
* every occurrance of the command EXIT:
*
* if muffle=0 then call MUFFLE
*
* Note 1: Use "call MUFFLE" as a command in your file as well to give
* the USER the option of toggling the Muffle Setting.
*
* Note 2: Be sure to add the above two lines to insure the user's
* chosen Muffle setting is returned to it's original setting!
*/
getuser 1101745;muffle=result;bbscommand 'who';call MUFFLE
bbscommand 'who';if muffle=0 then call MUFFLE ; bbscommand 'who'
exit
MUFFLE:;if muffle=0 then bbscommand 'MU *';return
/**[27]*********************************************************************
*
* Description: Extended SelectFile Routine.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: var=SELFILE(<file>,<bcost>,<fcost>,<kill>)
*
* Where: <file> is the file to add to the Select Buffer (incl. Path)
* <bcost> "0" if the byte is FREE, "100" to deduct 1*bytesize
* "150" to deduct 1.5*bytesize etc.
* <fcost> "0" if the file is FREE, "1" for file price of 1
* "2" for file price of 2 etc.
* <kill> "0"=Don't Kill, "1"=Kill when downloaded,
* "2"=Kill when dl/unselect, "3"=Kill when unselected.
*
* Returns: <var> "0" If selectbuffer is full.
* "1" If selecting was sucessfull.
*/
if SELFILE("s:startup-sequence",200,2,0) then transmit 'File added to selectbuffer'
else transmit 'Sorry - your selectbuffer is full!'
exit
SELFILE: procedure;arg np,bco,fco,ki
getuser 1209644;nu=result;getuser 2407246;if nu=result then return 0
pa=left(np,max(lastpos(':',np),lastpos('/',np)))
na=substr(np,length(pa)+1);si=word(statef(np),2)
sh=x2c(d2x(si,8))left(na,32,'00'x)left(pa,96,'00'x)copies('00'x,7)x2c(d2x(ki,2))x2c(d2x(si*bco%100,8))x2c(d2x(fco,4))copies('00'x,6)copies('FF'x,4)
getcarrier;if result~='TRUE' then exit;getuser 1401978
call export(x2c(d2x(result+nu*156,8)),sh)
setobject nu+1;putuser 1209644;return 1
/**[28]*********************************************************************
*
* Description: Add line of text to specified LOG file.
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call LOG("<name>","<text>","[path]")
*
* Where: <name> is the NAME of the LOG file to add to.
* <text> if the TEXT line to be added to the log.
* [path] if present, this specifies an alternate path to
* SAVE the LOG to. Defaults to "SysData:Log/"
*/
call LOG("test_log","As found in Sysdata:Log/ path.")
call LOG("test_log","As found in RAM: path!!","ram:")
sendfile 'sysdata:log/test_log'
sendfile 'ram:test_log'
exit
LOG: procedure;parse arg n,t,a;if Arg()=2 then a='SysData:Log/';n=a||n
call open(f9,n,substr('wa',exists(n)+1,1));call writeln(f9,t)
call close(f9);return
/**[29]*********************************************************************
*
* Description: Check Port Menu(s) Checkmark Status.
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
* PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: call PMENU(<port>,<item>)
*
* Where: <port> is the PORT to check. (Use 100 for ALL Ports).
* <item> is the item to check. Although you can type as much
* of the menu item text as you wish, only the first
* letter matters, as shown below:
*
* 's' to check "Sysop is in".
* 'n' to check "No new users".
* 'u' to check "UD base closed".
* 'p' to check "Pfiles closed".
* 'b' to check "Base closed".
*
* Returns: 0 if there is NO checkmark shown.
* 1 if there IS a checkmark shown.
*/
transmit " Menu for Port: 0n1"
call PMENU(0,s) ; transmit ' SysOp is in: 'word('No Yes',result+1)
call PMENU(0,n) ; transmit ' No new users: 'word('No Yes',result+1)
call PMENU(0,u) ; transmit 'UD base closed: 'word('No Yes',result+1)
call PMENU(0,p) ; transmit ' Pfiles closed: 'word('No Yes',result+1)
call PMENU(0,b) ; transmit ' Base closed: 'word('No Yes',result+1)
exit
PMENU: procedure;arg p,m;m=index('SNUPB',left(m,1))-1
getuser 2121864+(p*24);return bittst(d2c(result),m)
/**[30]*********************************************************************
*
* Description: Send Text File as CNet MAIL to specified User.
*
* Author(s): Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call MAIL([<id> | "<handle>" | "<name>"],"<subj>","<file>")
*
* Where: <id> can be the ID Number, Handle or Real Name of the
* user in which you'd like to send the mail item to.
*
* <subj> is the Subject to name the Mail Message.
*
* <file> if the path/filename of the text file to send.
*
* Returns: 0 if mail send FAILED. (File Not Found/Box Closed or Full)
* 1 if mail was sent successfully.
*/
if MAIL(1,"Last 10","gfiles:Last10") then transmit "Mailed successfully!"
else transmit "Mail send failed!"
exit
MAIL: procedure;parse arg id,subj,file;findaccount id'!';id=result
if ~exists(file) then do;transmit 'File not found!';return 0;end
loadeditor file;setmailsubj subj;writemail id;return result
/**[31]*********************************************************************
*
* Description: Send SystemOLM to current user.
*
* Author(s): Bill Beogelein - Amiga SWHQ +1 810/473-2020
* PMK - Flux Point Amiga BBS +45 3526-2527
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call SYSOLM(<msg>)
*
* Where: <msg> is the Message to appear as a "System OLM".
*
* Note: If you wish to add MCI-Commands into your OLM-text, then you
* need to DROP the \a1 and \@1 from the END of line number 920
* of your BBSTEXT file, so it reads:
*
* 920: \n1\c7**** System Message\n1
*
* Remember, the \'s are really CONTROL-Y's.
*/
call SYSOLM('This is a Test-OLM!!')
exit
SYSOLM: procedure;getuser 23;po=result;getuser 2307346;op=result'_olm'po
if exists(op) then m='A';else m='W';if open(f,op,m) then do
call writech(f,copies('00'x,30)'01'x||copies('00'x,23)arg(1)||'0a1a0a'x)
call close(f);sendstring 'M1101743 #1 + +}';end;return
/**[32]*********************************************************************
*
* Description: Add keystrokes to other ports from present port.
*
* Author(s): Aunt Bea - Blue Moon BBS +1 716/871-9866
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call ADDEM(<port>,"<keys>",<mode>)
*
* Where: <port> is the port number to add keystrokes too.
* <keys> are the keystrokes to add, within double quotes.
* <mode> as '1' and the user will see them,
* as '2' and the user will NOT see them.
*
* Returns: Keystrokes will be entered into the command stream on stated
* port. Nothing will be returned on your port.
*
* Example: call ADDEM(2,"o!",2) will logoff user on port 2 without them
* knowing what just happened!
*/
query ' Send to which port? ';port=result
query 'Add which keystrokes? ';keys=result
sendstring ' Disable serial port? ';getchar;a=result
if a='Y' then mode=2;else mode=1;transmit word('No Yes',mode)
call ADDEM(port,keys,mode)
exit
ADDEM: procedure;parse arg po,ke,mo;address ('CNETREXX'po)
modem mo;addkeys ke'`';modem 1;return
/**[33]*********************************************************************
*
* Description: A QUICK "Who" for SysOps, listing Access Group Number.
*
* Author(s): Aunt Bea - Blue Moon BBS +1 716/871-9866
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call WHO
*
* Returns: Displays all loaded ports, listing port number, handle,
* access group, speed, from and where info.
*/
call WHO
exit
WHO: procedure;transmit 'r1# 'left('Handle',21)left('AG SPD From',38)left('Location',16)'r0';getuser 2225094
hp=result;do po=0 to hp;getportid po;pi=result;if pi=-1 then iterate;loadscratch pi;savescratch (-pi)
getscratch 1;ha=result;getscratch 15;ac=result;getwhere po;wh=result;getscratch 1201214;cp=result%10
getscratch 4;fr=result;transmit left(po,3)left(ha,21)left(ac,3)left(cp,4)left(fr,31)left(wh,16);end;return
/**[34]*********************************************************************
*
* Description: View "port" log of specified port. (Pre "calls" log).
*
* Author(s): Aunt Bea - Blue Moon BBS +1 716/871-9866
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call LOGPO(<port>)
*
* Where: <port> is the port number to view the log of.
*
* Returns: Displays the "calls" log entry for this user, as it looks
* so far. By activating other log processes through CONFIG
* without assigning other log names for them, you can see
* what the user has done up to that point this call.
*/
query 'Port to view log of? ';po=result;call LOGPO(po);exit
LOGPO: procedure;arg p;if exists('sysdata:log/port'p) then sendfile 'sysdata:log/port'p
else transmit 'Port 'p' log not found.';return
/**[35]*********************************************************************
*
* Description: Send Line Noise to a port (Ability to kick them off too!)
*
* Author(s): Aunt Bea - Blue Moon BBS +1 716/871-9866
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call LNOISE(<port>,<drop>)
*
* Where: <port> is the port number to send Line Noise to.
* <drop> as '1' will also DROP CARRIER on that port,
* as '0' will NOT drop carrier. Just Annoy! hehe
*
* Returns: A check is done to make sure that the user using this routine
* is a Conference Controller and that the port number entered
* is a valid number. A check is also done to make sure the
* user issuing the Line Noise doesn't lose carrier themselves.
*/
query 'Send Line Noise to which Port? ';port=result
sendstring 'Should it also Drop Carrier? ';getchar;a=result
if a='Y' then drop=1;else drop=0;transmit word('No Yes',drop+1)
call LNOISE(port,drop)
exit
LNOISE: procedure;arg p,d;a=time('s');getuser 1100661;c=result;if bittst(d2c(c+(c<0)*256),7)=0 then exit
if p='###PANIC' then exit;getuser 2225094;hp=result;if p>hp|p<0|datatype(p,'n')=0 then exit
a.0='s1ou797¾s07i7';a.1='¾';a.2='«¾«¾y«¾®«¾7r';a.3='®6¾½¤80y9ohj;;'
a.4=':OJl;;ø·';a.5='¡¾½¼©w1µþð65 ®ð7';a.6='54®© 7 08o 7pi·¡'
a.7='¾µ¤P*o¡¤þ·7ue64s¼¢³ G';a.8='DXc .LJ. ;o8';a.9='n¡¾½#©ð¢e';a.10='¾¼43 5i6yYth98h¤«y)*Ou9i76y'
a.11='¡¾½f«¾s1¼®®«¾5»·y9i-»«s0098þ·r·«¾«¾«¾¡';a.12='utg9797n1¾þ'
a.13='T«¡¾þ®hgb¸ºmnªº vh,vbvÇn';a.14=' c Vxgedy';a.15='trd¡¤w1¡µðµþðç dd'
a.16='½þµðn1þµð';a.17='¤þ¡µðiyð';a.18='uy';address ('CNETREXX'p)
do for random(4,18);l=random(0,18);sendstring a.l;end;if d=1 then dropcarrier
do for random(4,18);l=random(0,18);sendstring a.l;end;bufferflush;return
/**[36]*********************************************************************
*
* Description: UnLock User Accounts (That May NOT Have Been Previously!)
*
* Author(s): Aunt Bea - Blue Moon BBS +1 716/871-9866
* Dotoran - Frontiers BBS +1 716/823-9892
*
***************************************************************************
*
* Usage: call UNLOCK(< id | handle | name >)
*
* Where: <id> is the ID number of the account to UnLock. This can
* also be specified as the Handle or Real Name of the
* user whose account you wish unlocked. Use "0" to
* UnLock ALL accounts on your system.
*
* Returns: Will tell you when it's done.
*
* Note: You should only run this file when there are NO OTHER ARexx
* tasks running simultaneously, as if one of these other tasks
* were to LOCK an account, Unlocking it prematurely may cause
* THAT task to fail or crash. This routine is meant as a FIX
* for any files using LOADSCRATCH where you believe there to
* be a problem with it not UNLOCKING the accounts.
*/
query 'Account to UnLock? [0=ALL]: ';p=result
call UNLOCK(p);exit
UNLOCK: procedure;arg p;getuser 2400088;ta=result;if p=0 then do i=1 to ta;savescratch (-i);sendstring '.';end i
else do;findaccount p;id=result;savescratch (-id);end;transmit 'Account(s) unlocked.';return
/**[37]*********************************************************************
*
* Description: Replace <input> with <output> within string of <text>.
* (A bit like the AREXX's TRANSLATE command, but NOT limited
* to replacing text of equal length)
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=REPLACE(<text>,<input>,<output>)
*
* Where: <text> holds the text to do replacement on.
* <input> is the text you want to replace.
* <output> is the text you want to appear instead of <input>
*
* Returns: <var> holds the replaced <text>.
*/
text='My handle is PMK, and this is a test!! - PMK!!'
transmit 'n1Before replace: 'text ; getuser 1 ; handle=result
transmit 'n1 After replace: 'REPLACE(text,'PMK',handle)
exit
REPLACE: procedure;parse arg a,b,c;d=index(a,b);do while d~=0
a=insert(c,delstr(a,d,length(b)),d-1);d=index(a,b);end;return a
/**[38]*********************************************************************
*
* Description: Find and return BBSMENU Line(s).
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: <var>=BMTXT(<menu>,[<line>])
*
* Where: <menu> BBSMENU Menu Number.
* <line> Line Number in Menu.
*
* Returns: <var> holds the returned BBSMENU Menu Line entry, if the
* <line> option was used, or else the number of lines
* in that BBSMENU Menu, while the "BMT.<x>" array will
* hold the BBSMENU listing.
*/
transmit 'Menu # 7, Item 6: 'BMTXT(7,6)
transmit 'Menu # 12, Item 3: 'BMTXT(12,3)
transmit 'Menu # 30, Item 8: 'BMTXT(30,8)
transmit 'n1Complete Menu # 2: n1'
do d=0 to BMTXT(2);transmit right(d,2)') 'bmt.d;end d;exit
BMTXT: procedure expose bmt.;b=ARG(1)*2;getuser 2401064;t=import(x2c(d2x(result,8)),220)
parse var t 13 p +4 =b+21 s +2 =b+121 l +2;if ARG()=2&(ARG(2)<=c2d(l)) then do
m=import(import(offset(p,4*(c2d(s)+ARG(2))),4),512);parse var m t'00'x;return translate(t,'\{','');end
c=0;do a=c2d(s) to (c2d(s)+c2d(l)-1);m=import(import(offset(p,4*a),4),512);parse var m t'00'x;bmt.c=translate(t,'\{','');c=c+1;end;return c-1
/**[39]*********************************************************************
*
* Description: Clears a specific port, by dumping the user. Similar to
* the DROPCARRIER command, but allows different log entries.
*
* Author(s): PMK - Flux Point Amiga BBS +45 3526-2527
*
***************************************************************************
*
* Usage: call DUMPUSER(<port>,<logoff>,[<quick>])
*
* Where: <port> is the port number to clear. (dumps user)
* <logoff> as '0' shows 'TIME LIMIT EXCEEDED' in the log.
* as '1' shows 'AUTO CALL-BACK FAILED' in the log.
* as '2' shows 'IDLE TIME EXCEEDED' in the log.
* as '3' shows 'LOST CARRIER' in the log.
* as '4' shows 'INSTANT LOGOFF' in the log.
* as '5' shows 'NORMAL LOGOFF' in the log.
* as '6' shows 'RE-LOGON' in the log.
* as '7' shows '$ BALANCE TOO LOW' in the log.
* as '8' shows 'DUMPED BY SYSOP' in the log.
* as '9' shows 'FILE XFER AUTO-LOGOFF' in the log.
* as '10' shows 'MCI % COMMAND' in the log.
* as '11' shows 'TERM LINK' in the log.
* <quick> if '1', a quick logoff is performed. (similar to
* the normal 'O!' - No SYS.END is displayed.)
*
* A check is done to make sure that the port number entered
* is a valid number, and the port is occupied by a user.
*
* Returns: '0' if the dumping failed (no user on port, bad port etc.)
* '1' if the user was successfully dumped.
*/
call dumpuser(0,3)
exit
DUMPUSER:procedure;arg p,d,q;if q~=1 then q=0
getportid p;if result=-1|~datatype(p,'W')|~datatype(d,'W')|d<0|d>11 then return 0
address ('CNETREXX'p);sendstring 'L1109799 #'q'}L1200022 #'d'}L1109807 #1}';addkeys '`';return 1
/**[40]*********************************************************************
*
* Description: EnCode & DeCode text strings, using a Numeric Key. Given the
* desired text string, along with a numeric key, the text will
* be encoded using a specific code string. The text can then
* only be decoded using the same numeric key.
*
* Author(s): Dotoran - Frontiers BBS +716 823-9892
*
***************************************************************************
*
* Usage: To EnCode a text string, use the ENCODE() function:
*
* <var> = ENCODE( <text> , <key> )
*
* Where: <var> is the variable the encoded text will be placed.
* <text> is the text string(or variable holding text string)
* that needs to be encoded.
* <key> is a numeric value between 1 and 94. Values below 1
* or greater than 94 will return INCORRECT results!
*
* Usage: To DeCode a coded text string, use the DECODE() function:
*
* <var> = DECODE( <text> , <key> )
*
* Where: <var> is the variable the decoded text will be stored in.
* <text> is the ALREADY CODED text string you wish to DeCode.
* This can also be a variable containing coded text.
* <key> is the SAME numeric key you used to MAKE the initial
* coded string. If you do NOT use the SAME numeric key,
* then the text will NOT be DeCoded correctly.
*
* Notes: This technique comes in real handy when you wish to encrypt
* data before saving it to disk. The data can then be decoded
* as it is read in the next time it is needed.
*/
query " Enter the text to Encode: ";a=result
query "Key value(between 1 and 94): ";k=result
y=ENCODE(a,k);z=DECODE(y,k);transmit
transmit "Entered Text: "a
transmit "EnCoded Text: "y
transmit "DeCoded Text: "z
exit
ENCODE:procedure;parse arg t,k;a=xrange(" ","~")
k=xrange(d2c(32+k),"~")xrange(" ",d2c(31+k));return translate(t,a,k)
DECODE:procedure;parse arg t,k;a=xrange(" ","~")
k=xrange(d2c(32+k),"~")xrange(" ",d2c(31+k));return translate(t,k,a)
****************************************************************************
Contributing Authors:
PMK - Flux Point Amiga BBS +45 3526-2527
Dotoran - Frontiers BBS +1 716/823-9892
Aunt Bea - Blue Moon BBS +1 716/871-9866
Thomas - Dreamline Amiga BBS +45 3582-7043
Bill Beogelein - Amiga SWHQ +1 810/473-2020